package database;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;

public class dbConnect {
	
	public static Connection getConnection()
	{
		try {
			DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());

			Connection con = DriverManager.getConnection(
					"jdbc:oracle:thin:@dbhost.ugrad.cs.ubc.ca:1521:ug", "ora_e6m5", "a52132057");

			// create a connection
			con.createStatement();
			
			return con;
			

		} catch(SQLException e) {
			System.out.println(e);
		}
		return null;
	}
	
	public static void closeConnection(Connection con){
		try {
			con.close();
		}
		catch (Exception e) {
			System.err.println("Can't close DB connection");
		}
	}
}
